use comb, clear

/* First row (Number of subjects) */
tab sample

/* Second row: median age */
by sample, sort: tabstat age, stat(p50)
tabstat age, stat(p50)

/* Third row: proportion male (%) */
ren gender male
by sample, sort: tabstat male, stat(mean)
tabstat male, stat(mean)

/* Chose investment rule (%) */
by sample, sort: tabstat daOrRule, stat(mean)
tabstat daOrRule, stat(mean)
